<template>
	<view>
		<text>参数错误</text>
	</view>
</template>

<script>
	const crypto = require('crypto');
	export default{
		onLoad(options) {
			if(options.uid == '111111')
			{
				this.navTo('/pages/entry/login');	
			}
			
		},
		methods: {
			md5(string){
				return crypto.createHash('md5').update(string).digest("hex").toLowerCase();
			},
			getSign(params, secret)
			{
				var unSignParaString = formatQueryParaMap(params);
				var signStr = md5(unSignParaString + "&appsecret=" + secret);
				return signStr;	  
			},
			formatQueryParaMap(params)
			{
				var keys = Object.keys(params);
				keys.sort();
				var outstr = "";
				keys.forEach(function(key)
					{
						if(params[key])
						{
							outstr = outstr + key + "=" + params[key] + "&";
						}
					}
				);
				if (outstr.length > 0) {
					outstr = outstr.substr(0, outstr.length - 1);
				}	
				return outstr;
			}
		}
	}
	

</script>

<style>
</style>
